package cn.crex1.xiaomi.core.mvc.beans.config;

import java.lang.reflect.Field;

import cn.crex1.xiaomi.core.mvc.annotation.Bean;
import cn.crex1.xiaomi.core.mvc.beans.BeanMetadata;

public class BeanFieldMetadata implements BeanMetadata {
	
	private String beanFieldName;
	
	private Field beanField;
	
	@Override
	public String getTyeName() {
		return beanFieldName;
	}

	@Override
	public Object getTyeClass() {
		return beanField;
	}

	@Override
	public Object getModifierType() {
		return null;
	}

	@Override
	public void setTyeName(Object beanField) {
		Field field=(Field) beanField;
		if (BeanDefinitionUtil.isAnnotation(Bean.class, field)) {
			this.beanFieldName=field.getName();			
		}

	}

	@Override
	public void setTyeClass(Object beanClass) {
		this.beanField=(Field) beanClass;
	}

	@Override
	public void setModifierType(Object beanField) {
	}

}
